{# This template is the parent for viewing contents, settings, charts, commits of a repository. #}
{% extends 'base/session-base.html' %}
{% load djacket_filters %}

{% block page_title %}
    {{repo_owner}} / {{repo_name}}
{% endblock %}

{% block view_title %}
    <section id="title">
        {% block title_section %}
            <div id="repo-url">
                <h1>
                    <a href="/{{repo_owner}}">{{repo_owner}}</a>
                     /
                    <a id="repo-link" href="/{{repo_owner}}/{{repo_name}}.git">{{repo_name}}</a>
                </h1>
            </div>
        {% endblock %}
    </section>
    <section id="options">
        <ul>
            {% if request.user.is_authenticated and request.user.username == repo_owner %}
                <li><a title="Repository Settings" href="/{{repo_owner}}/{{repo_name}}.git/settings"><i class="fa fa-cog"></i></a></li>
            {% endif %}
        </ul>
    </section>
{% endblock %}

{% block content %}
    <div id="repo-tabs" class="pjax-tabs">
        <ul class="tab-links">
            <li id="browse-tab" class="{% if template == 'browse' %}active{% endif %}">
                <a data-pjax href="/{{repo_owner}}/{{repo_name}}.git">
                    <i class="fa fa-sitemap"></i> Browse
                </a>
            </li>
            <li id="branches-tab" class="{% if template == 'branches' %}active{% endif %}">
                <a data-pjax href="/{{repo_owner}}/{{repo_name}}.git/branches">
                    <i class="fa fa-random"></i> Branches
                </a>
            </li>
            <li id="commits-tab" class="{% if template == 'commits' %}active{% endif %}">
                <a data-pjax href="/{{repo_owner}}/{{repo_name}}.git/commits">
                    <i class="fa fa-tasks"></i> Commits
                </a>
            </li>
            <li id="graphs-tab" class="{% if template == 'graphs' %}active{% endif %}">
                <a data-pjax href="/{{repo_owner}}/{{repo_name}}.git/graphs">
                    <i class="fa fa-area-chart"></i> Graphs
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div id="pjax-container" class="tab active">
                {% include 'repository/repo-sections.html' %}
            </div>
        </div>
    </div>
{% endblock %}
